#define _CRT_SECURE_NO_WARNINGS

void Insertsort(int *a,int n) {
	for (int i = 0; i < n - 1; i++) {
		int end = i;
		int tmp = a[end + 1];
		while (end >= 0) {
			if (a[end] > tmp) {
				a[end + 1] = a[end];
				end--;
			}
			else {
				break;
			}
		}
		a[end + 1] = tmp;
     }
}


int main() {
	int a[8] = { 4,5,2,3,6,7,8,9 };
	Insertsort(a, 8);


	return 0;
}